package com.example.demo.dao;

import com.example.demo.pojo.Coupon;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CouponDao {
    int deleteByPrimaryKey(Integer couponid);

    int insert(Coupon record);

    int insertSelective(Coupon record);

    Coupon selectByPrimaryKey(Integer couponid);

    int updateByPrimaryKeySelective(Coupon record);

    int updateByPrimaryKey(Coupon record);


    //通过优惠卷类型查询
    @Select("SELECT * FROM coupon WHERE type=#{type}")
    List<Coupon> selectByType(String type);

    List<Coupon> getAll();
}